from word_search import Solution


board = [
    ['A', 'B', 'C', 'E'],
    ['S', 'F', 'C', 'S'],
    ['A', 'D', 'E', 'E']
]


def test():
    assert Solution().exist(board, "ABCCED")


def test1():
    assert Solution().exist(board, "ASA")


def test2():
    assert Solution().exist(board, "ADA") == False


def test3():
    assert Solution().exist(board, "SEE") == True


def test4():
    assert Solution().exist(board, "ABCB") == False


def test_loop():
    assert Solution().exist(board, "ABFB") == False
    assert Solution().exist(board, "ABCCEDF") == True
    assert Solution().exist(board, "ABCCEDFB") == False


def test5():
    assert Solution().exist([["a"]], "a") == True


def test_error():
    b = [["A","B","C","E"],
        ["S","F","E","S"],
        ["A","D","E","E"]]
    w ="ABCEFSADEESE"
    assert Solution().exist(b, w) == True
